From a4587ef4a0988bd6817895fa7920801163091ca6 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 28 Sep 2015 05:42:04 +0200 Subject: [PATCH] widget: Warn on calls to queue_resize() during size_allocate() This happens way too much, so it's disabled unless GTK_DEBUG=geometry is on. Also, we can't detect it in the call to queue_resize() yet, only during size_allocate(), so the warning comes after the signal emission. --- gtk/gtkwidget.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index ce77407a64..948c07e981 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -5991,6 +5991,13 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget, GTK_WIDGET_GET_CLASS (widget)->size_allocate (widget, &real_allocation); /* Size allocation is god... after consulting god, no further requests or allocations are needed */ +#ifdef G_ENABLE_DEBUG + if (GTK_DEBUG_CHECK (GEOMETRY) && gtk_widget_get_resize_needed (widget)) + { + g_warning ("%s %p or a child called gtk_widget_queue_resize() during size_allocte().", + gtk_widget_get_name (widget), widget); + } +#endif gtk_widget_ensure_resize (widget); priv->alloc_needed = FALSE; -- 2.30.2